package com.hfjy.bigdata.impl

import org.apache.flink.streaming.connectors.elasticsearch6.RestClientFactory
import org.apache.http.message.BasicHeader
import org.elasticsearch.client.RestClientBuilder

/**
  * Created by kehailin on 2018-8-16. 
  */
class RestClientFactoryImpl extends RestClientFactory{

    override def configureRestClientBuilder(restClientBuilder: RestClientBuilder): Unit = {
        restClientBuilder.setDefaultHeaders(Array(new BasicHeader("Content-Type", "application/json")))  //以数组的形式可以添加多个header
        restClientBuilder.setMaxRetryTimeoutMillis(1000)
    }
}
